home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
LDB171.ARJ
/
EXAMP504.CPP
< prev
next >
Wrap
Text File
|
1992-05-12
|
752b
|
32 lines
// examp504.cpp - link with strbdr.obj and binder.obj
// rework of examp503.cpp
#define sfile "examp504.txt"
#include <string.h>
#include <fstream.h>
#include "strbdr.hpp"
main()
{
StrBdr sb(BDR_DDELETE | BDR_DNEW | BDR_DSTORE);
sb.ins(strdup("line one"));
sb.insNew("line two");
ofstream os(sfile);
if (!os) return 1;
os << sb;
os.close();
StrBdR sB;
ifstream is(sfile);
if (!is) return 1;
is >> sB;
is.close();
if (!sB) return 1;
sB->setCurNode(); // reset current node
while (sB->next()) cout << (char *)*sB << "\n";
delete sB;
return 0;
}